<template>
    <div class="outer" style="margin-top: -10px">
        <div class="nav_bar">
            <div class="nav_bar_inner">
                <i class="iconfont icon-home" @click.stop="$router.push('/')"></i><span @click.stop="$router.push('/')">首页</span>><span @click.stop="$router.push('/industry')">行业动态</span>><span>动态详情</span>
            </div>
        </div>
        <div class="inner">

            <div class="title">
                {{newsDetail.title}}
            </div>
            <div class="time_icon_and_time">
                <i class="iconfont icon-clock time_icon"></i><span class="time">{{newsDetail.createTime}}</span>
            </div>
            <template v-if="newsDetail.smallPicUrl != ''">
                <div class="banner">

<!--                    <el-image v-if="(newsDetail.smallPicUrl == null) || (newsDetail.smallPicUrl == '')"  style="width: 903px; height: 220px;margin: 0px auto;" src="https://img2.baidu.com/it/u=3666548066,2508071679&fm=26&fmt=auto" :fit="fit"></el-image>-->
<!--                    <el-image v-else style="width: 903px; height: 220px;margin: 0px auto;" :src="basePath.dev+newsDetail.smallPicUrl" :fit="fit"></el-image>-->
                        <img v-if="(newsDetail.smallPicUrl == null) || (newsDetail.smallPicUrl == '')" src="https://img2.baidu.com/it/u=3666548066,2508071679&fm=26&fmt=auto">
                        <img v-else :src="basePath.dev+newsDetail.smallPicUrl">
                </div>
            </template>

            <div class="content" :innerHTML='newsDetail.newsContent'>

            </div>

            <div class="bottom_block">

            </div>

        </div>
    </div>
</template>

<script>
    import {NewsDetail} from "../../api/new";
    import baseConfig from '@/utils/config'
    export default {
        name: "detail",
        data(){
            return{
                newsDetail:{},
                basePath:{}
            }
        },
        mounted(){
            window.scrollTo(0,0)
            console.log('typeid he id ',this.$route.query.typeid,this.$route.query.id)

            NewsDetail({id:this.$route.query.id}).then(res=>{
                console.log('新闻详情接口',res)
                this.newsDetail=res.data
            })

            this.basePath=baseConfig

        }
    }
</script>

<style scoped>
    .outer{
        width:100%;
        overflow: hidden;
    }

    .nav_bar{
        width: 100%;
        height: 50px;
        background: #2EB0C6;
        line-height: 50px;
        overflow: hidden;
        margin-top: 10px;
    }

    .nav_bar_inner{
        width: 1000px;
        height: 100%;
        line-height: 50px;
        margin: 0px auto;
    }
    .nav_bar_inner i,span{
        cursor: pointer;
        font-size: 14px;
        font-family: Microsoft YaHei;
        font-weight: 400;
        color: #030303;
    }

    .inner{
        width: 1003px;
        background: #FFFFFF;
        margin: 0px auto;
        overflow: hidden;
        margin-bottom: 86px;
    }
    .title{
        font-size: 24px;
        line-height: 24px;
        font-family: Microsoft YaHei;
        font-weight: bold;
        color: #333333;
        text-align: center;
        margin-top: 47px;
    }
    .time_icon_and_time{
        text-align: center;
        margin-top: 26px;
        overflow: hidden;
    }
    .time_icon_and_time i{
        font-size: 16px;
        line-height: 16px;
        color: #999999;
    }
    .time_icon_and_time span{
        font-size: 14px;
        font-family: Microsoft YaHei;
        font-weight: 400;
        color: #999999;
        line-height: 14px;
        margin-left: 8px;
        margin-top: 20px;
    }
    .banner{
        width: 903px;
        height: 220px;
        background: red;
        margin: 0px auto;
        margin-top: 40px;
    }
    .banner>img{
        width: 100%;
        height: 100%;
        object-fit: fill;
    }
    .content{
        margin: 0px auto;
        margin-top: 38px;
        width: 908px;
        font-size: 16px;
    }
    .bottom_block{
        width: 100%;
        height: 78px;
    }
</style>
